﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using bdtheque.business.interfaces;

namespace bdtheque.business.bo
{
    public sealed class Factory : IFactory
    {
        // Singleton Implementation
        private Factory() { }

        // Singleton Implementation
        public static Factory GetInstance
        {
            get { return FactoryImpl.instance; }
        }

        // Factory Method
        public T Create<T>()
            where T : new()
        {
            return new T();
        }

        // Singleton Implementation
        private class FactoryImpl
        {
            internal static readonly Factory instance = new Factory();

            static FactoryImpl() { }
        }
    }
}
